package com.zzty.txj1.service.impl;

import com.zzty.txj1.dao.TeamExamDao;
import com.zzty.txj1.dao.TeamExamMapper;
import com.zzty.txj1.entity.Search;
import com.zzty.txj1.entity.TeamExam;
import com.zzty.txj1.service.TeamExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class TeamExamServiceImpl implements TeamExamService {
    @Autowired
    TeamExamMapper teamExamMapper;
@Autowired
    TeamExamDao teamExamDao;
    @Override
    public Integer checkDate(String date) {
        Integer count=teamExamMapper.checkDate(date);
        System.out.println("checkDate count: "+count);
        return count;
    }

    @Override
    public Integer addTeamExamQuestion(TeamExam teamExam) {
        Integer count=teamExamMapper.addQuestionId(teamExam);
        System.out.println("addTeamExamQuestion count: "+count);
        return count;
    }

    @Override
    public List<TeamExam> getTeamExam(Search search){
        List<TeamExam> teamExams=teamExamDao.getTeamExam(search);
        return teamExams;
    }

    @Override
    public TeamExam checkByDateAndClazzId(TeamExam teamExam) {
        TeamExam teamExam1 = teamExamDao.checkByDateAndClazzId(teamExam);
        return teamExam1;
    }

    @Override
    public Integer insertTeamExam(TeamExam teamExam) {
        Integer count=teamExamDao.addTeamExam(teamExam);
        return count;
    }

    @Override
    public List<TeamExam> getTeamExamByClazzId(TeamExam teamExam) {
        List<TeamExam> teamExams=new ArrayList<>();
        teamExams=teamExamDao.getSelfExamByClazzId(teamExam);
        return teamExams;
    }



}
